/********************************************
  This file is used to test the correctness of
  PCB.h and PCB.c

*********************************************/

#include <stdlib.h>
#include "mpx_supt.c"
#include "PCB.c"


void main () {

PCB *p1,*p2;
p1 = allo_pcb( );

p1 = set_pcb(p1,1,"Tiger",READY, 100);

printf("The1st PCB\n");
printf("The PCB has the following elements:\n");
printf("ID is %d\n", p1->pcb_id);
printf("Name is %s\n", p1->pcb_name);
printf("Status is %d\n",p1->pcb_state);
printf("Priority is %d\n",p1->pcb_priority);

if (!free_pcb (p1) )
printf(" Working successfully.");
else
printf(" Sth wrong.");

p2 = allo_pcb();
p2= set_pcb(p2,9,"Bird",RUNNING, 200);

printf("The 2nd PCB\n");
printf("The PCB has the following elements:\n");
printf("ID is %d\n", p2->pcb_id);
printf("Name is %s\n", p2->pcb_name);
printf("Status is %d\n",p2->pcb_state);
printf("Priority is %d\n",p2->pcb_priority);

if (!free_pcb (p2) )
printf(" Working successfully.");
else
printf(" Sth wrong.");


return;
}